<template>
	<view class="content">
		<uni-collapse accordion="true">
		    <uni-collapse-item title="增加大赛通知" thumb="../../static/zengjia.png">
		        <view >
					首页图
		            <tupian @func="getNoticeFromSon"></tupian>
					内容图1
					<tupian @func="oneImg"></tupian>
					内容图2
					<tupian @func="twoImg"></tupian>
					<!-- <view>通知内容：</view> -->
					<!-- <view class="uni-textarea">
						<textarea style="border: 1px solid #CCE6FF;" focus maxlength="-1" value="" placeholder="请输入通知内容" @blur="notice"/>
					</view> -->
					<input style="width:90%;line-height:20px;margin-bottom: 10px;text-align: center;height: 35px;" type="text" value="" maxlength=-1 placeholder="请输入通知内容" @input="notice"/>
		            <input style="text-align: center;height: 35px;margin-bottom: 10px;" type="text" value="" placeholder="请输入标题" @input="noticeTitle"/>
		            <!-- <input style="text-align: center;height: 35px;margin-bottom: 10px;" type="number" value="" placeholder="请输入2" @input="noticeType"/> -->
					<button @click="tongzhi">完成</button>
		        </view>
		    </uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	import tupian from '../tupian/tupian.vue'
	import uniCollapse from '../../components/uni-collapse/uni-collapse.vue'
	import uniCollapseItem from '../../components/uni-collapse-item/uni-collapse-item.vue'
	import uniSection from '../../components/uni-section/uni-section.vue'
	export default{
		data(){
			return{
				noticeList:{
					noticesfromSon:'',
					noticesinfo:'',
					noticeTitle:'',
					noticeType:0,
					oneImage: '',
					twoImage: ''
				}
			}
		},
		methods:{
			notice: function (e) {
				console.log(e.detail.value)
				//获得添加的通知内容
				this.noticeList.noticesinfo = e.detail.value
			},
			getNoticeFromSon(data){
				this.noticeList.noticesfromSon = data
				// console.log("大赛通知内容为："+data)
				//获取的通知图片
			},
			oneImg(data){
				this.noticeList.oneImage=data
			},
			twoImg(data){
				this.noticeList.twoImage=data
			},
			noticeTitle: function(e) {
				this.noticeList.noticeTitle = e.detail.value
				// console.log(this.noticeTitle)
			},
			// noticeType: function(e) {
				// this.noticeList.noticeType = e.detail.value
				// console.log(this.noticeTitle)
			// },
			tongzhi(){
				this.$emit('func',JSON.stringify(this.noticeList))
			},
		},
		components:{uniCollapse,uniCollapseItem,uniSection,tupian}
	}
</script>

<style lang="scss" scoped>
	view{
		width: 100%;
		font-size: 14px;
		text-align: left;
		background-color: #fff;
		// border-bottom: 2px solid #DDDDDD;
		line-height: 40px;
		button{
			width: 50%;
			font-size: 12px;
			background-color: #CCE6FF;
			margin: 10px auto;
		}
		input{
			width: 60%;
			border: 2px solid #CCE6FF;
			font-size: 12px;
			margin: 5px auto;
		}
		
	}
</style>
